<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>类的定义</title>
</head>
<body>
    <script>
        class Person{

          //构造方法
          constructor(name,age) {
            this.name =name;
            this.age =age;
          }

          //show
          show(){
            document.write(this.name+","+this.age+"<br>");
          }
        }

        //使用person类
        let p =new Person("小张",18);
        p.show();



        let Student={
            name: "李四",
            age:19,
            hobby:["吃鸡","砍鸭"],

          game:function (){
              document.write("卢本伟牛逼")
          }
        };

        document.write(Student.name+","+Student.age+","+Student.hobby);
        Student.game();
    </script>
</body>
</html>